package com.mkx.controller;

import com.mkx.service.SecondCaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Second Case RESTful Controller
 * 提供HTTP接口，供外部系统调用
 */
@RestController
public class SecondCaseController {

    @Autowired
    private SecondCaseService secondCaseService;

    /**
     * RESTful接口：获取服务信息
     * @param name 请求参数
     * @return 服务响应结果
     */
    @GetMapping("/api/second-case/info")
    public String getServiceInfo(@RequestParam String name) {
        return secondCaseService.getServiceInfo(name);
    }

    /**
     * RESTful接口：处理数据
     * @param data 待处理数据
     * @return 处理结果
     */
    @GetMapping("/api/second-case/process")
    public String processData(@RequestParam String data) {
        return secondCaseService.processData(data);
    }

    /**
     * RESTful接口：调用其他服务
     * @param message 要传递给其他服务的消息
     * @return 调用结果
     */
    @GetMapping("/api/second-case/call-other")
    public String callOtherService(@RequestParam String message) {
        return secondCaseService.callOtherService(message);
    }
}